<?php
header('content-type:text/html;charset=utf8;');
$link = mysqli_connect('localhost:3306','root','');
mysqli_query($link,'set names utf8');
mysqli_query($link,'use letao');
$res = mysqli_query($link,'select * from product');
if(!$res || mysqli_num_rows($res) == 0){
die('暂无数据');
}
$arr = [];
while($row = mysqli_fetch_assoc($res)){
$arr[] = $row;
}
// print_r($arr);
?> 
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h1>商品列表</h1>
<ul>
<?php for($i=0;$i<count($arr);$i++){ ?>
<li>
<h3><?=$arr[$i]['proName']?></h3>
<p>价格：￥<?=$arr[$i]['price']?></p>
</li>
<?php } ?>
</ul>
</body>
</html>